package com.xiuxia.usercenterbackend.common.exception;

import com.xiuxia.usercenterbackend.common.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @ClassName GlobalExceptionHandler
 * @Author CHENBO
 * @Date 2024/12/17 10:21
 */
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(BusinessException.class)
    public R handle(BusinessException e){
        return R.fail(e.getResponseCode(), e.getMessage());
    }

}
